$(function(){
	$.showLoading();
	$.ajax({
		url : appPath + '/order/getExpress.json',
		dataType : 'json',
		type : 'post',
		data : {
			token : $.cookie("token"),
			storageOrderId:$('#storageOrderId').val()
		},
		success : function(data) {
			$.hideLoading();
			if (data.code == -1) {
				$.alert("请登录",function(){
					window.location = appPath + "/member/login.html";			
				});				
				return;
			}
			if (data.code == 0) {
				$.alert(data.msg);
				return;
			} else {
				var result=eval('['+data.msg+']')[0];
				if (!result.Success){
					$.alert(result.Reason);
					return;
				}else{
					if(result.State==2){
						$('#state').text('在途中');
					}
					if(result.State==3){
						$('#state').text('已签收');
					}
					if(result.State==4){
						$('#state').text('问题件');
					}
					var eList=result.Traces;
					for(var i=eList.length-1;i>=0;i--){
						var str='';
						str=str+'<div class="ckwl"><div class="ckwl_left">';
						if(i==eList.length-1){
							str=str+'<img src="'+$('#staticPath').val()+'/images/express_over.png" />';
						}else{
							str=str+'<img src="'+$('#staticPath').val()+'/images/express.png" />';
						}
						str=str+'</div><div class="ckwl_right"><ul>';
						str=str+'<li>'+eList[i].AcceptStation+'</li>';
						str=str+'<li>'+eList[i].AcceptTime+'</li>';
						str=str+'</ul></div></div>';
						$(str).appendTo($('#list'));
					}
					
				}
			}
		},error:function(){
			$.hideLoading();
			$.alert("系统异常，请重试");
		}
	})
})
